package fr.bull.learn.thread.task;

import org.apache.log4j.Logger;

import fr.bull.learn.thread.util.Chrono;

/**
 * Just for computing
 * @author Rouviere-X
 *
 */
public class ComputeTask implements Runnable {
	private Logger log = Logger.getLogger(getClass());
	int resM =2, resA=0;
	
	@Override
	public void run() {
		int cpt =0;
		Chrono c = new Chrono();
		c.start();
		while (true) {
			cpt++;
			resM = resM * cpt;
			resA += cpt;
			if (cpt % 1000000 == 0) {
				c.stop();
				log.debug("C="+c+"-resM["+resM+"] "+"resA["+resA+"]");
				c.start();
			}
		}
	}

}
